#ifndef AIENTRY_H
#define AIENTRY_H
#define MIN 1e-6
#define LOW_POINTS 50
#define MIDDLE_POINTS 150
#define CLOSE_INSTANCE 80
#include <QMainWindow>
#include <QObject>
#include <QWidget>
#include "player.h"
#include <cmath>

//检查受击次数由Player完成，AIPlayer设置受击次数达到3次后躲避的逻辑

class AIEntry
{
public:
    AIEntry(Player* p);
    void init();
    void run(Player* p);
    ///获取角色坐标
    int* getPlayerSite(Player *P1player);
    Player* newAIPlayer(Player *p);
    ///获取玩家方向状态
    PlayerStatus getStatus(Player* p);
    ///获取玩家相对方向
    PlayerStatus getRelativePos(Player* p,Player *aip);
    void ifEvade(Player* p);
    bool judgeInstance(Player* p,float instance);
    ///判断ai和角色的距离是否合适(是否较近，攻击或移动)
    void findAndDeci(Player* p);
    ///判断相对方向，释放技能
    void releRealativeSkill(Player* p);
private:
    Player* ai;
    ///判断距离远近
    bool res;
    ///获取随机数
    int t;
signals:
    void isOnFloor(QString name);
};

#endif // AIENTRY_H
